package com.broada.apm.utils;

import com.google.common.primitives.Longs;


public class LongUtils {
	public static long fromUint32(int i) {
		return 0xFFFFFFFFL & i ;
	}
	public static long toBigEndian(long l) {
		byte[] bytes = Longs.toByteArray(l);
		return Longs.fromBytes(bytes[7],bytes[6],bytes[5],bytes[4],bytes[3],bytes[2],bytes[1],bytes[0]);
	}
	public static long toLittleEndian(long l) {
		byte[] bytes = Longs.toByteArray(l);
		return Longs.fromBytes(bytes[7],bytes[6],bytes[5],bytes[4],bytes[3],bytes[2],bytes[1],bytes[0]);
	}
}
